Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unset-value

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unset-value

Delete nested properties from an object using dot notation.

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17M
increased by8.83%
Maintainers
1
Weekly downloads
 
Created

What is unset-value?

The unset-value npm package is used to remove properties from an object. It allows you to delete a nested property from an object using a dot-path or an array of keys without mutating the original object.

What are unset-value's main functionalities?

Unsetting a property using a dot-path

This feature allows you to remove a nested property from an object by specifying the path to the property using a string with dot notation. For example, if you have an object `{ a: { b: { c: 7 } } }` and you want to remove the property `c`, you can use `unset(object, 'a.b.c')`.

{"object": {"a": {"b": {"c": 7}}}, "path": "a.b.c"}

Unsetting a property using an array of keys

This feature is similar to the dot-path method but uses an array of keys to specify the path to the property. It is useful when property names are dynamic or not valid identifiers. For example, `unset(object, ['a', 'b', 'c'])` will remove the property `c` from the object.

{"object": {"a": {"b": {"c": 7}}}, "path": ["a", "b", "c"]}

Other packages similar to unset-value

Keywords

FAQs

Package last updated on 25 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc